<template>
	<view style="background: #ffffff;height: 100vh;">
		<hx-navbar ref="hxnb" :config="config" />
		<view style="padding:0 30rpx ;">
			<view style="color: #1E1E1E;font-size: 64rpx;font-weight:650;margin-top: 30rpx;">步骤1/1</view>
			<view style="font-size: 32rpx;">你最喜欢什么风格的设计？</view>
		</view>
		<view class="flex flex-direction justify-center align-center" style="text-align:center;margin-top: 80rpx;"
			v-for="(item,index) in data">
			<view class="styleData" :class="styleType==index ? 'follorw' :''" @tap="clickType(item,index)">{{item}}
			</view>
		</view>
		<view class="wancher" style="" @tap="goIndex">完成</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 标题栏配置
				config: {
					title: "",
					back: true,
					backgroundColor: [1, "rgb(240 243 250)"],
				},
				data: ['简约', '欧式', '田园'],
				styleType: 0,
				styleValue: '',
				type: null,
				id: null
			}
		},
		onLoad(e) {
			console.log(e.type, '哈哈哈')
			this.type = e.type
			this.id = e.id
			if (this.type == 2) {
				this.data = ['简装', '古典', '中式']
			}
			this.styleValue = '简约'
		},
		methods: {
			clickType(e, a) {
				this.styleType = a
				this.styleValue = e
				console.log('杀杀杀', this.styleValue)
			},
			goIndex() {
				this.type = Number(this.type)
				let data = {
					type: this.type,
					style: this.styleValue,
					id: this.id
				}
				console.log('哈哈哈哈', this.type)
				this.$api.occupation(data).then((res) => {
					if (this.type == 2) {
						this.$tools.goPageNoAuth('../../clientEnd/page/decoration/Application?type=' + this.type +
							'&id=' +
							this.id)
					} else if (this.type == 1) {
						uni.switchTab({
							url: '/pages/tabbar/clientEndTabbar/ClientHome'
						})
					}
					// if (res.data.code == 0) {
					// 	uni.switchTab({
					// 		url: '/pages/tabbar/clientEndTabbar/ClientHome'
					// 	})
					// } else {
					// 	this.$tools.showToast(res.data.result)
					// }
				})
			}
		}
	}
</script>

<style scoped>
	.styleData {
		width: 624rpx;
		height: 144rpx;
		background: #FFFFFF;
		border-radius: 112rpx 112rpx 112rpx 112rpx;
		opacity: 1;
		line-height: 144rpx;
		font-size: 32rpx;
		border: 2rpx solid rgba(30, 30, 30, 0.1);
	}

	.follorw {
		background: rgba(73, 45, 34, 0.2);
		border: 4rpx solid #492D22;
	}

	.wancher {
		position: fixed;
		bottom: 0;
		color: #FFFFFF;
		font-size: 36rpx;
		width: 750rpx;
		text-align: center;
		line-height: 200rpx;
		height: 200rpx;
		background: #492D22;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		opacity: 1;
	}
</style>
